/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    margin: 0;
    overflow-x: hidden;
}

#app {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 260px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header .logo i {
    font-size: 1.5rem;
}

.sidebar-header .logo h2 {
    font-size: 1.2rem;
    margin: 0;
    font-weight: 600;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.sidebar-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.mobile-toggle {
    display: none;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    border-left-color: white;
}

.nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: 0;
}

/* 顶部导航栏 */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #e1e5e9;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
}

.header-title h1 {
    font-size: 1.5rem;
    color: #333;
    font-weight: 600;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* 内容包装器 */
.content-wrapper {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

/* 内容区域 */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* 快速操作 */
.quick-actions {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
    overflow: hidden;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.action-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #333;
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.action-card i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.action-card h3 {
    font-size: 1.1rem;
    margin: 0.5rem 0;
    color: #333;
}

.action-card p {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #1e7e34;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

/* 主要内容区域 */
.main {
    padding: 2rem 0;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: #666;
    font-size: 0.9rem;
}

/* 面板样式 */
.control-panel,
.search-panel,
.data-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    overflow: hidden;
}

.panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-content {
    padding: 1.5rem;
}

/* 控制按钮组 */
.control-group h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.1rem;
}

.control-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 搜索表单 */
.search-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select {
    padding: 10px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

/* 数据表格 */
.data-count {
    color: white;
    font-size: 0.9rem;
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.no-data {
    text-align: center;
    color: #666;
    font-style: italic;
}

/* 加载和消息提示 */
.loading,
.message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading {
    background: rgba(0, 0, 0, 0.5);
}

.loading-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.message {
    background: rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.message-content {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 1rem;
    pointer-events: all;
}

.message-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #666;
}

.hidden {
    display: none !important;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e1e5e9;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: #f8f9fa;
}

/* 报告详情样式 */
.report-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meta-item label {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
}

.meta-item span {
    color: #333;
    font-size: 1rem;
}

.report-content .content-section {
    margin-bottom: 2rem;
}

.report-content .content-section h3 {
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

.content-text {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    line-height: 1.6;
    color: #333;
}

.content-html {
    background: white;
    padding: 1rem;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    line-height: 1.6;
    color: #333;
}

.content-html p {
    margin-bottom: 1rem;
}

/* 设置页面样式 */
.settings-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.settings-group {
    margin-bottom: 2rem;
}

.settings-group h3 {
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item label {
    font-weight: 500;
    color: #333;
}

.setting-item input {
    padding: 8px 12px;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    width: 120px;
}

.setting-item input[type="checkbox"] {
    width: auto;
    transform: scale(1.2);
}

.settings-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* 仪表板样式 */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 2rem;
}

.metric-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-left: 4px solid #667eea;
}

.metric-card:hover {
    transform: translateY(-4px);
}

.metric-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.metric-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 0.25rem 0;
}

.metric-content p {
    color: #666;
    font-size: 0.9rem;
    margin: 0 0 0.5rem 0;
}

.metric-change {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

.metric-change.positive {
    background: #d4edda;
    color: #155724;
}

.metric-change.negative {
    background: #f8d7da;
    color: #721c24;
}

.metric-label {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

/* 图表区域 */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.chart-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.chart-panel .panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-panel .panel-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.time-range-select {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.time-range-select:hover {
    background: rgba(255, 255, 255, 0.2);
}

.time-range-select option {
    background: #333;
    color: white;
}

.chart-panel .panel-content {
    padding: 1.5rem;
}

.chart-panel canvas {
    max-width: 100%;
    height: auto;
}

/* 活跃度网格 */
.activity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.activity-item {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.activity-item:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.activity-item h4 {
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 0.5rem 0;
    font-weight: 500;
}

.activity-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

/* 图表响应式 */
@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-panel .panel-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .activity-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .metric-card {
        flex-direction: column;
        text-align: center;
    }

    .activity-grid {
        grid-template-columns: 1fr;
    }
}

/* 分页样式 */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-top: 1px solid #e1e5e9;
    margin-top: 1rem;
}

.pagination-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: #666;
    font-size: 0.9rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-numbers {
    display: flex;
    gap: 0.25rem;
    margin: 0 0.5rem;
}

.page-number {
    padding: 6px 12px;
    border: 1px solid #e1e5e9;
    background: white;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-number:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.page-number.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.page-number.disabled {
    background: #f8f9fa;
    color: #ccc;
    cursor: not-allowed;
    border-color: #f0f0f0;
}

@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .pagination-controls {
        justify-content: center;
        flex-wrap: wrap;
    }

    .pagination-info {
        text-align: center;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-toggle {
        display: block;
    }

    .sidebar-toggle {
        display: block;
    }

    .header-content {
        padding: 1rem;
    }

    .header-title h1 {
        font-size: 1.2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .control-buttons {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
    }

    .action-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        padding: 1rem;
    }

    .modal-content {
        max-height: 95vh;
    }

    .report-meta {
        grid-template-columns: 1fr;
    }

    .modal-footer {
        flex-direction: column;
    }

    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .content-wrapper {
        padding: 1rem;
    }

    .panel-content {
        padding: 1rem;
    }

    .table-container {
        font-size: 0.85rem;
    }

    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .btn-sm {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
}

/* 报告类型过滤器样式 */
.report-type-filter {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    white-space: nowrap;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-outline-primary {
    background: white;
    color: #007bff;
    border: 2px solid #007bff;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: #007bff;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-outline-primary.active {
    background: #007bff;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.report-type-btn {
    position: relative;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.report-type-btn i {
    margin-right: 0.5rem;
}

/* 响应式报告类型过滤器 */
@media (max-width: 768px) {
    .filter-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .btn-group {
        width: 100%;
        justify-content: space-between;
    }

    .report-type-btn {
        flex: 1;
        text-align: center;
        font-size: 0.85rem;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .btn-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .report-type-btn {
        width: 100%;
        justify-content: center;
    }
}

/* 仪表盘样式 */
.dashboard-container {
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    position: relative;
}

.dashboard-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 119, 198, 0.2) 0%, transparent 50%);
    pointer-events: none;
}

.overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.overview-card {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: none;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: cardSlideIn 0.6s ease-out forwards;
}

.overview-card:nth-child(1) { animation-delay: 0.1s; }
.overview-card:nth-child(2) { animation-delay: 0.2s; }
.overview-card:nth-child(3) { animation-delay: 0.3s; }
.overview-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes cardSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-50px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.overview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.overview-card:hover::before {
    transform: scaleX(1);
}

.overview-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.overview-card .card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.4rem;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
}

.overview-card .card-icon::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.overview-card:nth-child(1) .card-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.overview-card:nth-child(2) .card-icon {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    box-shadow: 0 8px 20px rgba(17, 153, 142, 0.4);
}

.overview-card:nth-child(3) .card-icon {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    box-shadow: 0 8px 20px rgba(252, 182, 159, 0.4);
}

.overview-card:nth-child(4) .card-icon {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    box-shadow: 0 8px 20px rgba(255, 154, 158, 0.4);
}

.overview-card .card-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.4rem;
    line-height: 1.2;
}

.metric-change {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    display: inline-block;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.metric-change.positive {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.metric-change.negative {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
    gap: 1.8rem;
    margin-bottom: 2.5rem;
    animation: fadeInUp 1s ease-out 0.5s both;
}

.chart-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.chart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.chart-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.chart-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 0.8rem 1.5rem;
    background: transparent;
    border-bottom: none;
}

.chart-card .card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chart-controls select {
    padding: 0.5rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 0.9rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    font-weight: 600;
    color: #495057;
    transition: all 0.3s ease;
}

.chart-controls select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chart-card .card-body {
    padding: 0 1.5rem 1.5rem 1.5rem;
    height: 320px;
    position: relative;
}

.volatility-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    height: 100%;
}

.volatility-section h4 {
    margin: 0 0 1.5rem 0;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #2c3e50;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.volatility-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 美化按钮样式 */
.btn-refresh {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-refresh::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-refresh:hover::before {
    left: 100%;
}

.btn-refresh:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-refresh:active {
    transform: translateY(0);
}

/* 美化标题 */
.dashboard-container h1 {
    text-align: center;
    color: white;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

.dashboard-container h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    border-radius: 2px;
    animation: underlineGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); }
    100% { text-shadow: 0 4px 30px rgba(255, 255, 255, 0.2), 0 0 40px rgba(255, 255, 255, 0.1); }
}

@keyframes underlineGlow {
    0% { box-shadow: 0 0 5px rgba(255, 255, 255, 0.3); }
    100% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.6); }
}

/* 加载动画美化 */
.loading-overlay {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
    backdrop-filter: blur(10px);
}

.loading-spinner {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.loading-spinner i {
    font-size: 3rem;
    color: white;
    margin-bottom: 1rem;
    animation: spin 1s linear infinite, pulse 2s ease-in-out infinite alternate;
}

.loading-spinner p {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

/* 响应式设计改进 */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 1rem;
    }

    .dashboard-container h1 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    .overview-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .overview-card {
        padding: 1.2rem;
    }

    .overview-card .card-icon {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
        margin-right: 0.8rem;
    }

    .metric-value {
        font-size: 1.4rem;
    }

    .charts-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .chart-card .card-header {
        padding: 1.2rem 1.2rem 0.8rem 1.2rem;
    }

    .chart-card .card-body {
        padding: 0 1.2rem 1.2rem 1.2rem;
        height: 280px;
    }
}

@media (max-width: 480px) {
    .dashboard-container h1 {
        font-size: 1.6rem;
    }

    .overview-card {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }

    .overview-card .card-icon {
        margin-right: 0;
        margin-bottom: 0.8rem;
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .metric-value {
        font-size: 1.3rem;
    }
}

.volatility-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid transparent;
}

.volatility-item:has(.positive) {
    border-left-color: #28a745;
}

.volatility-item:has(.negative) {
    border-left-color: #dc3545;
}

.product-name {
    font-weight: 500;
    color: #333;
}

.change-rate {
    font-weight: 600;
    font-size: 0.9rem;
}

.change-rate.positive {
    color: #28a745;
}

.change-rate.negative {
    color: #dc3545;
}

.summary-section {
    margin-top: 2rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.summary-item label {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

.summary-item span {
    font-size: 1rem;
    color: #333;
    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .charts-container {
        grid-template-columns: 1fr;
    }

    .chart-card .card-body {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: 1rem;
    }

    .overview-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .overview-card {
        padding: 1rem;
    }

    .overview-card .card-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .metric-value {
        font-size: 1.5rem;
    }

    .chart-card .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .chart-controls {
        width: 100%;
        justify-content: flex-end;
    }

    .chart-card .card-body {
        height: 300px;
        padding: 1rem;
    }

    .volatility-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }
}

/* 仪表盘预览样式 */
.dashboard-embed-container {
    padding: 1.5rem;
}

.dashboard-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.dashboard-preview {
    margin-bottom: 2rem;
}

.preview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.preview-card {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.preview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.preview-card .card-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 1.2rem;
    color: white;
}

.preview-card .card-icon.price-index {
    background: linear-gradient(135deg, #007bff, #0056b3);
}

.preview-card .card-icon.vegetables {
    background: linear-gradient(135deg, #28a745, #1e7e34);
}

.preview-card .card-icon.fruits {
    background: linear-gradient(135deg, #ffc107, #e0a800);
}

.preview-card .card-icon.meat {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.preview-card .card-content h3 {
    margin: 0 0 0.25rem 0;
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

.preview-card .metric-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.125rem;
}

.preview-card .metric-change {
    font-size: 0.75rem;
    font-weight: 600;
}

.chart-preview {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.chart-preview h4 {
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    color: #333;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-container {
    height: 200px;
    position: relative;
}

.dashboard-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.dashboard-summary .summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dashboard-summary .summary-item label {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

.dashboard-summary .summary-item span {
    font-size: 0.9rem;
    color: #333;
    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .dashboard-actions {
        flex-direction: column;
        align-items: center;
    }

    .preview-cards {
        grid-template-columns: 1fr;
    }

    .preview-card {
        padding: 0.75rem;
    }

    .preview-card .card-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .chart-container {
        height: 150px;
    }

    .dashboard-summary {
        grid-template-columns: 1fr;
    }
}

/* 爬取选项样式 */
.crawl-options {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.crawl-options h4 {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 1rem;
    font-weight: 600;
}

.crawl-options .form-group {
    margin-bottom: 1rem;
}

.crawl-options .form-group label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
}

.crawl-options .form-group input[type="checkbox"] {
    margin-top: 0.2rem;
    transform: scale(1.2);
}

.help-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

.crawl-options .control-buttons {
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .crawl-options {
        margin-top: 1rem;
        padding: 0.75rem;
    }

    .crawl-options h4 {
        font-size: 0.95rem;
    }

    .help-text {
        font-size: 0.8rem;
    }
}
